package com.steven.design.JieGou_Pattern.adapter;

public class CarAdapter implements CarKey{

   public AdvanceKey advanceKey;

   public CarAdapter(String carType){
       if(carType.equalsIgnoreCase("aodi") ){
           advanceKey = new AoDiKey();
       } else if (carType.equalsIgnoreCase("baoma")){
           advanceKey = new BaoMaKey();
       }
   }

    @Override
    public void open(String carType) {
        if(carType.equalsIgnoreCase("aodi")){
            advanceKey.openAD();
        }else if(carType.equalsIgnoreCase("baoma")){
            advanceKey.openBM();
        }
    }
}
